Skip to content

Optimize public schedule speaker queries - #4810

Merged
patrick91 merged 1 commit into
mainfrom
codex/optimize-public-schedule-query
Aug 17, 2026
Merged

Optimize public schedule speaker queries#4810
patrick91 merged 1 commit into
mainfrom
codex/optimize-public-schedule-query

Conversation

@patrick91

Copy link
Copy Markdown
Member

Summary

  • prefetch participant avatar files for submission, keynote, and additional schedule speakers
  • add an exact frontend schedule query regression covering all three speaker sources

Why

ScheduleItemUser is a DTO, so Strawberry Django cannot propagate the nested Participant.photo optimization through it. Uploaded avatars therefore caused one additional SQL query per speaker across the public schedule.

The frontend operation now stays constant at 13 queries for submission/additional-speaker schedules and 14 for keynote schedules as item count grows from one to four.

Validation

  • 6 exact frontend query-count cases
  • 31 related schedule, keynote, and talk tests
  • Ruff formatting and lint checks
  • regenerated GraphQL SDL with no diff

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Error Error Aug 17, 2026 9:10pm

@claude

claude Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Adds select_related("photo_file") to the three speaker-participant prefetches on ScheduleItem.speakers (via explicit Prefetch objects) so avatar lookups don't add a query per speaker, plus a new regression test asserting exact query counts for submission/keynote/additional-speaker schedule items.

No issues found.

Minor, non-blocking note: the new test hardcodes exact query counts (13/14) via django_assert_num_queries. That's intentional as a tight regression guard here, but it will fail on any unrelated resolver/annotation change to this query (e.g. adding a new field elsewhere in SCHEDULE_QUERY), so expect some maintenance churn.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.11%. Comparing base (29e4c07) to head (374411c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4810   +/-   ##
=======================================
  Coverage   93.11%   93.11%           
=======================================
  Files         360      360           
  Lines       11239    11241    +2     
  Branches      905      905           
=======================================
+ Hits        10465    10467    +2     
  Misses        663      663           
  Partials      111      111           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@patrick91
patrick91 marked this pull request as ready for review August 17, 2026 21:15
@patrick91
patrick91 merged commit 88cbd8e into main Aug 17, 2026
8 of 9 checks passed
@patrick91
patrick91 deleted the codex/optimize-public-schedule-query branch August 17, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant